Don't issue the iptables diagnostic when removing entries. Depending upon your
authoremellor@leeni.uk.xensource.com <emellor@leeni.uk.xensource.com>
Fri, 25 Nov 2005 17:08:22 +0000 (17:08 +0000)
committeremellor@leeni.uk.xensource.com <emellor@leeni.uk.xensource.com>
Fri, 25 Nov 2005 17:08:22 +0000 (17:08 +0000)
hotplug config, the offline event may come through to this script twice, and
the iptables -D will fail the second time.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
tools/examples/vif-common.sh

index a8750f94b42c4b5c474e3dda326f647b2dadcc27..f7a488082a6a61e2915564ad32a3664c5a5db94f 100644 (file)
@@ -63,6 +63,7 @@ function frob_iptable()
   fi
 
   iptables "$c" FORWARD -m physdev --physdev-in "$vif" "$@" -j ACCEPT ||
+    [ "$c" == "-D" ] ||
     log err \
      "iptables $c FORWARD -m physdev --physdev-in $vif $@ -j ACCEPT failed.
 If you are using iptables, this may affect networking for guest domains."